import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';

class Mydialog extends StatelessWidget {
  const Mydialog({super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoAlertDialog(
      title: const Text(
        "确定要选择“不休眠”吗?",
        style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
      ),
      content: const Padding(
        padding: EdgeInsets.only(top: 8.0),
        child: Text(
          "选择“不休眠”设备将不会进入休眠状态，可能会影响设备电池功耗，造成耗电情况，影响设备使用时长",
          style: TextStyle(fontSize: 16, fontWeight: FontWeight.w300),
          textAlign: TextAlign.start,
        ),
      ),
      actions: [
        // 取消按钮
        CupertinoDialogAction(
          onPressed: () {
            Get.back(result: false);
          },
          child: const Text(
            "取消",
            style: TextStyle(color: CupertinoColors.systemGrey),
          ),
        ),
        CupertinoDialogAction(
          onPressed: () {
            Get.back(result: true);
          },
          child: const Text(
            "确认",
            style: TextStyle(color: Color(0xFF9860F6)),
          ),
        ),
      ],
    );
  }
}
